﻿using Common.Service;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using RabitPart.ReadApi;
using RabitPart.WritedPartApi.Application.Comman.CultivationFile;

namespace RabitPart.WritedPartApi.Controllers
{
    /// <summary>
    /// 养殖--控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CultivationPartController : ControllerBase
    {
        private readonly IMediator mediator;
        private readonly ILogger<CultivationPartController> logger; 
        public CultivationPartController(IMediator mediator, ILogger<CultivationPartController> logger)
        {
            this.mediator = mediator;
            this.logger = logger; 
        }

        /// <summary>
        /// 养殖厂--添加
        /// </summary>
        /// <returns>养殖厂--添加</returns>
        [HttpPost]
        public async Task<ApiResult> CreateCultivation(CultivationComman model)
        { 
            return await mediator.Send(model);
        }


        /// <summary>
        /// 养殖企业信息--添加
        /// </summary>
        /// <returns>养殖企业信息--添加</returns>
        [HttpPost]
        public async Task<ApiResult> CreateCultivationcorporate(CultivationcorporateComman model)
        { 
            return await mediator.Send(model);
        } 



    }
}
